package utils.httpclient;


import utils.SmallTool;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class AVLogWriteUtil {
    public static void WriteLog(String LogInfo, String threadid) {
        String path = "/usr/local/updatepmdataWriteLog/";
        File file = new File(path);
        if (!file.exists()) {
            file.mkdir();
        }
        String FileName = path + new SimpleDateFormat("yyyyMMdd").format(new Date()) + "_" + threadid + ".txt";

        FileWriter fileWritter;
        try {
//				SmallTool.printMess(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "：" + LogInfo + "【第" + (threadid + 1) + "线程】");
            fileWritter = new FileWriter(FileName, true);
            BufferedWriter bufferWritter = new BufferedWriter(fileWritter);
            bufferWritter.write(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "：" + LogInfo + "\r\n");
            bufferWritter.close();
        } catch (IOException e) {
            SmallTool.printMessError("异常信息++" + e.getMessage());
        }


    }

}


